package BookOperation;

import Book.Book;
import Book.BookList;

import java.util.Scanner;

public class BorrowBook implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("请输入你要借阅的书籍");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        int size = bookList.getUseSize();
        for (int i = 0; i <size ; i++) {
           Book book = bookList.getBook(i);
            if (name.equals(book.getBookName())) {
               book.setLend(true);
                return;
            }
        }
        System.out.println("没有此书");
    }
}
